package com.login.springboot.controller;

import com.login.springboot.entity.User;
import com.login.springboot.service.impl.UserServiceImpl;
import com.login.springboot.util.MyResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserServiceImpl userService;
    @ResponseBody
    @RequestMapping("/login")
    public MyResult login(@RequestBody User user){
        return userService.login(user);
    }
}
